<template>
  <a-card :bordered="false">
    <a-table bordered
             size="middle"
             rowKey="id"
             :columns="columns"
             :dataSource="dataSource"
             :pagination="false"
             :loading="loading">
      <template slot="akEllipsis" slot-scope="text">
        <AkEllipsis :value="text"></AkEllipsis>
      </template>
    </a-table>
  </a-card>
</template>

<script>
    import AkEllipsis from '../../components/akfh/AkEllipsis'
    import {baseLang} from '../../api/url'
    import { getAction } from '../../api/manage'

    export default {
      name: 'ModuleList',
      components: { AkEllipsis },
      describe:'模块列表',
      data(){
        return {
          columns:[
            {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
            {
              title: "模块编号",
              dataIndex: "no",
              scopedSlots: { customRender: "akEllipsis" }
            },
            {
              title: "模块名称",
              align: "center",
              dataIndex: "name",
              scopedSlots: { customRender: "akEllipsis" }
            },
            {
              title: "模块描述",
              align: "center",
              dataIndex: "describe",
              scopedSlots: { customRender: "akEllipsis" }
            },],
          dataSource:[],
          loading:false,
        }
      },
      mounted() {
        this.loading = true;
        getAction(baseLang.module.list)
          .then(res=>{
            if(res.success){
              this.dataSource = res.result;
            }
          })
          .finally(()=>{
            this.loading = false;
        })
      }
    }
</script>

<style scoped>

</style>